{% extends "base.html" %}
{% load i18n %}
{% load markup %}

{% block title %}{% trans "Documents" %}{% endblock %}

{% block extrahead %}
<link rel="alternate" type="application/rss+xml" title="RSS 2.0"
      href="http://{{ site.domain }}/rss/documents/" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" 
      href="http://{{ site.domain }}/atom/documents/" />
{% endblock %}

{% block content %}
<h2>{% trans "Documents" %}</h2>
{% for document in latest %}
<div>
  <h3><a href="{{ document.get_absolute_url }}">
  {% ifequal document.content_type "html" %}<img src="/media/icons/html.png" alt="(HTML)"/></a>{% endifequal %}{% ifequal document.content_type "doc" %}<img src="/media/icons/document.png" alt="(Word Document)"/></a>{% endifequal %}{% ifequal document.content_type "odt" %}<img src="/media/icons/document.png" alt="(OpenOffice Document)"/></a>{% endifequal %}{% ifequal document.content_type "pdf" %}<img src="/media/icons/document.png" alt="(PDF)"/></a>{% endifequal %}{% ifequal document.content_type "txt" %}<img src="/media/icons/text.png" alt="(Plain-text)"/></a>{% endifequal %}
  <a href="{{ document.get_absolute_url }}">{{ document.title }}</a></h3>
  <p class="date">{{ document.pub_date|date:"l, F jS, Y" }}</p>
  <p class="byline">{% trans "Posted by" %}{% ifnotequal document.user.get_full_name "" %} {{ document.user.get_full_name }}{% else %}{{ document.user.username }}{% endifnotequal %}</p>
  {% ifnotequal document.summary "" %}{{ document.summary|truncatewords:20 }}{% endifnotequal %}
</div>
{% endfor %}
{% endblock %}
